var xsskill = {
  onLoad: function() {
    // initialization code
    this.initialized = true;
    this.strings = document.getElementById("xsskill-strings");
    document.getElementById("contentAreaContextMenu")
            .addEventListener("popupshowing", function(e) { this.showContextMenu(e); }, false);
    alert("Running");
    try
    {
        var xsskillsvc = Components.classesByID["{25444c60-c400-11dd-ad8b-0800200c9a66}"]
                                   .createInstance(Components.interfaces.nsIObserver);
        alert("Made");
    }
    catch(e)
    {
    	alert(e);
    }
  },

  showContextMenu: function(event) {
    // show or hide the menuitem based on what the context menu is on
    // see http://kb.mozillazine.org/Adding_items_to_menus
    document.getElementById("context-xsskill").hidden = gContextMenu.onImage;
  },
  onMenuItemCommand: function(e) {
    var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
                                  .getService(Components.interfaces.nsIPromptService);
    promptService.alert(window, this.strings.getString("helloMessageTitle"),
                                this.strings.getString("helloMessage"));
  },

};
window.addEventListener("load", function(e) { xsskill.onLoad(e); }, false);
